﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;


namespace IncubatorServices
{
    public static class GenericHelper
    {
        public static List<Quiz> GetAllQuizzes()
        {
            sqlManager sql = new sqlManager();
            string query = "SELECT id FROM quiz";
            //int max = Int32.Parse(sql.GetScalar(query));
            DataSet ds = sql.GetDataSet(query);

            List<Quiz> ql = new List<Quiz>();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int id = sqlManager.GetDataInt(dr["id"]);
                Quiz q = new Quiz();
                q.LoadData(id);
                ql.Add(q);
            }
            return ql;
        }
    }
}
